package com.ruowei.modules.foodOrder.repository;

import com.ruowei.common.repository.BaseRepository;
import com.ruowei.modules.foodOrder.domain.MerchandiseAttributes;

import com.ruowei.modules.foodOrder.domain.QMerchandiseAttributes;
import org.springframework.stereotype.Repository;

import java.util.Optional;

/**
 * Spring Data  repository for the MerchandiseAttributes entity.
 */
@SuppressWarnings("unused")
@Repository
public interface MerchandiseAttributesRepository extends BaseRepository<Long, MerchandiseAttributes, QMerchandiseAttributes> {

    Boolean existsByAttributeNameAndMerchandiseCodeAndStatus(String attributeName, String merchandiseCode, Boolean status);

    Optional<MerchandiseAttributes> findOneByAttributeCode(String attributeCode);

    Optional<MerchandiseAttributes> findOneByAttributeCodeAndStatus(String attributeCode, Boolean status);

    void deleteByAttributeCode(String attributeCode);

    Optional<MerchandiseAttributes> findOneByAttributeNameAndStatusAndMerchandiseCode(String attributeName, Boolean status, String merchandiseCode);

    Optional<MerchandiseAttributes> findFirstByAttributeNameAndMerchandiseCode(String attributeName, String merchandiseCode);
}
